/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util;

import Presentacion.Hora;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.LinkedList;
import java.util.List;
import negocio.Actividad;

/**
 *
 * @author djphilomath
 */
public class Util {

    public static Date getPreviousMonday(Date today) {
        GregorianCalendar gc = new GregorianCalendar();
        gc.setTime(today);
        while (gc.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) gc.add(Calendar.DATE, -1);
        return gc.getTime();
    }

    public static Date getNextSunday(Date today) {
        GregorianCalendar gc = new GregorianCalendar();
        gc.setTime(today);
        while (gc.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY) gc.add(Calendar.DATE, 1);
        return gc.getTime();
    }

    public static List<Hora> actividadToHora(List<Actividad> l) {
        List<Hora> h = new LinkedList<Hora>();
        for (Actividad s : l) {
            
        }
        return h;
    }


}
